package com.stqf.scala.utils

import com.fasterxml.jackson.databind.{JsonNode, ObjectMapper}

import java.nio.charset.StandardCharsets

object ProUtils {
  val om = new ObjectMapper()

  def parse(bin: Array[Byte]): JsonNode = {
    val content = new String(bin, StandardCharsets.UTF_8)
    om.readTree(content)
  }

  def isBlank(str: String): Boolean = {
    if (str == null) {
      return true
    }
    str.trim.isEmpty
  }
}
